package com.hb.trade.client.project;

import cn.hutool.json.JSONObject;
import com.hb.core.pojo.parent.PageResult;
import com.hb.core.pojo.project.proj.dto.InquiryProjectThanDTO;
import com.hb.core.pojo.project.proj.entity.AbstractProject;
import com.hb.core.pojo.project.proj.entity.QueryProject;
import org.fzzn.core.model.msg.Message;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("hb-project")
public interface ProjectClient {

    /**
     * 该接口的参数类型参照  包下的结构进行传值
     *
     * @param projectJSON
     * @return
     * @see InquiryProjectThanDTO
     */
    @PostMapping("/project/newProject")
    Message<Boolean> newProject(@RequestBody JSONObject projectJSON);

    /**
     * @param project: 查询项目列表信息参数
     * @Description: 查询项目列表信息
     * @Author: zhongdl
     * @Date:2021/12/2 10:48
     * @return: org.fzzn.core.model.msg.Message<com.hb.core.pojo.parent.PageResult < cn.hutool.json.JSONObject>>
     **/
    @PostMapping("/project/projects")
    Message<PageResult<AbstractProject>> projects(@RequestBody QueryProject project);

    /**
     * @Description: 获取指定项目的详情
     * @Author: zhongdl
     * @Date:2021/12/2 16:50
     * @return: {@link Message< AbstractProject> }
     **/
    @PostMapping("/project/detail")
    Message<AbstractProject> projectDetail(AbstractProject project);

    /**
     * @param projectJSON:
     * @Description: 更新发起流程的项目信息
     * @Author: zhongdl
     * @Date:2021/12/2 16:58
     * @return: {@link Message< Boolean> }
     **/
    @PostMapping("/project/update")
    Message<Boolean> updateNewProject(@RequestBody JSONObject projectJSON);

    /**
     *
     * @Description: 查询未推送过的项目列表
     * @Author: zhongdl
     * @Date:2022/2/17 15:35
     * @param projectJSON:
     * @return: {@link Message< List< AbstractProject>> }
     **/
    @PostMapping("/project/listProjectAllFieldsDTO")
    Message<List<AbstractProject>> listProjectAllFieldsDTO(@RequestBody JSONObject projectJSON);

    /**
     *
     * @Description: 根据标段id查询项目的详情
     * @Author: zhongdl
     * @Date:2022/2/25 10:44
     * @param sectionId: 标段id
     * @return: {@link Message< AbstractProject> }
     **/
    @PostMapping("/project/detailBySectionId")
    Message<AbstractProject> detailBySectionId(@RequestBody Long sectionId);

    /**
     * @Description: 项目列表伪删除
     *
     * @author yuezheng
     * @param abstractProject
     * @return org.fzzn.core.model.msg.Message
     * @date 2022/6/30 16:46
     */
    @PostMapping("/project/deleteProjectById")
    Message deleteProjectById(@RequestBody AbstractProject abstractProject);
}
